<!DOCTYPE html>
<html>
	<head>
    	<meta charset="utf-8">
    	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
    	<link rel="shortcut icon" href="{{asset('favicon.ico')}}">

    	<title>Metalógica - BMP</title>

	    <!-- Bootstrap core CSS -->
	    {{ HTML::style('css/bootstrap.min.css'); }}
	    {{ HTML::style('css/bootstrap2-buttons.css'); }}
	    {{ HTML::style('css/dataTables.bootstrap.css'); }}
	    {{ HTML::style('css/select2.css'); }}
	    {{ HTML::style('css/sidebar.css'); }}
	    {{ HTML::style('css/jquery-ui.bpm.costscentres.css'); }}
	    
	    <!-- Custom styles for this template -->
	    {{ HTML::style('css/metalogica-template.css'); }}
	    
	    {{ HTML::script('js/jquery-1.11.0.min.js'); }}
	    
	    <script type="text/javascript">$.rootUrl = "{{URL::to('/')}}/";</script>
	    
	    {{ HTML::script('js/jquery.dataTables.min.js'); }}
	    {{ HTML::script('js/dataTables.bootstrap.js'); }}
	    {{ HTML::script('js/jquery-ui-1.9.2.custom.min.js'); }}
	    {{ HTML::script('js/jquery.maskedinput.js'); }}
	    {{ HTML::script('js/jquery.ui.touch-punch.min.js'); }}
	    {{ HTML::script('js/application.js'); }}
	
	    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
	    <!--[if lt IE 9]>
			{{ HTML::script('https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js'); }}	
			{{ HTML::script('https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js'); }}
	    <![endif]-->
	</head>
	<body>
		<div class="navbar navbar-default navbar-fixed-top" role="navigation">
      		<div class="container-fluid">
        		<div class="navbar-header">
          			<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
			            <span class="sr-only">Toggle navigation</span>
			            <span class="icon-bar"></span>
			            <span class="icon-bar"></span>
			            <span class="icon-bar"></span>
         			</button>

          			{{ HTML::link('dashboard', 'Metalógica', array('class' => 'navbar-brand')) }}
        		</div>
        		<div class="navbar-collapse collapse">
          			<ul class="nav navbar-nav navbar-right">
          				@if (in_array('admin', $userPrivileges) || in_array('crud', $userPrivileges))
			          		<li>{{ HTML::link('order', 'Pedidos') }}</li>
			          	@endif
			          	<li>{{ HTML::link('dashboard', 'Relatórios') }}</li>
			          	@if (in_array('admin', $userPrivileges) || in_array('crud', $userPrivileges))
				          	<li class="dropdown">
						    	<a href="#" class="dropdown-toggle" data-toggle="dropdown">Cadastro <b class="caret"></b></a>
						    	<ul class="dropdown-menu">
						        	<li>{{ HTML::link('customer', 'Cliente') }}</li>
				                	<li>{{ HTML::link('product', 'Item de Catálogo') }}</li>
				                	@if (in_array('admin', $userPrivileges))
				                		<li>{{ HTML::link('user', 'Usuários') }}</li>
				                	@endif
						        </ul>
						    </li>
						@endif
			            <li class="dropdown">
			            	<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ $loggedUser }}<b class="caret"></b></a>
			            	<ul class="dropdown-menu">
			            		<li>{{ HTML::link('loggedUser', 'Alterar Senha') }}</li>
			            		<li>{{ HTML::link('login/logout', 'Logout') }}</li>
			            	</ul>
			            </li>
          			</ul>
        		</div>
      		</div>
    	</div>

		{{ $content }}

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    {{ HTML::script('js/bootstrap.min.js'); }}
    {{ HTML::script('js/handlebars-v1.3.0.js'); }}
    {{ HTML::script('js/jquery-ui.bpm.dashboard.js'); }}
    {{ HTML::script('js/jquery-ui.bpm.report.js'); }}
	{{ HTML::script('js/jquery-ui.bpm.costscentres.js'); }}
	{{ HTML::script('js/select2.min.js'); }}
	{{ HTML::script('js/select2_locale_pt-BR.js'); }}
	{{ HTML::script('js/jquery.textTruncate.js'); }}
    <!-- Templates temporários, serão compilados posteriorment -->
    <script id="tplNewComponent" type="text/x-handlebars-template">
		<div class="form-group">
  			<label for="inputCustomer" class="col-sm-2 control-label">Componente</label>
  			<div class="col-sm-9">
    			<div class="input-group">
      				<input type="text" class="form-control" name="components[]">
      				<span class="input-group-btn">
        				<button type="button" class="btn btn-default btnRemoveComponent">
          					<span class="glyphicon glyphicon-trash"></span>
        				</button>
      				</span>
    			</div>
  			</div>
		</div>
	</script>
	<script id="tplNewComponentWithCostCentre" type="text/x-handlebars-template">
		<div class="form-group component-group">
			<div class="col-sm-2" style="padding-right: 3px;">
				<select name="accessories[]" class="form-control cboOperationType">
					<option value="0"@{{#unless isAccessory}} selected@{{/unless}}>Operação</option>
					<option value="1"@{{#if isAccessory}} selected@{{/if}}>Insumo</option>
				</select>
			</div>
			<div class="col-sm-2 col-component">
				<input type="text" class="form-control txtCigamCode" name="cigamCodes[]" value="@{{code}}" autocomplete="off" required="required"@{{#if isAccessory}} readonly="readonly"@{{/if}}>
			</div>
			<div class="col-sm-1 col-component">
				<input type="text" class="form-control" name="amounts[]" value="@{{amount}}" autocomplete="off" required="required">
			</div>
  			<div class="col-sm-4 col-component">
    			<input type="text" class="form-control" name="components[]" value="@{{name}}" autocomplete="off" required="required">
  			</div>
  			<div class="col-sm-3 col-component">
				<input type="hidden" name="costCentres[]" value="@{{costsCentres}}">
    			<button type="button" class="btn btn-danger btn-sm btnRemoveComponent" data-toggle="tooltip" data-placement="top" title="Remover Componente">
      				<span class="glyphicon glyphicon-trash"></span>
    			</button>
  			</div>
		</div>
	</script>
  </body>
</html>